1. Field of the Invention
The present invention relates generally to storing and retrieving information, and in particular to systems and methods for verifying information when the information is read out of memory.
2. Description of Related Art
Conventional network devices, such as routers, relay packets from a source to a destination through a network. Typically, each network device includes a memory subsystem that temporarily buffers packets while certain parts of the packet are processed. For example, the packet may be buffered while a route lookup is performed on the packet header, or while packet accounting is performed. After packet processing is done, the packet is read out of the memory subsystem and forwarded by the network device.
Packets are buffered in a variety of ways. For example, a network device may use a linked list to buffer packets or portions of packets in the memory subsystem. Each member of the linked list may include packet-related data, such as a portion of the packet or other information related to the packet. Each member also includes an address to the location of the next member in the list. Reading a packet out of the memory subsystem involves first reading the head member of the linked list using an address to the head member. Since each member includes an address to the next member, the remaining members of the list can be read out sequentially. The packet-related data is extracted from the members of the linked list, processed, and forwarded.
Packets may be buffered in other ways as well. For example, packet segments may be stored in sequential memory locations or randomly in memory. A list of addresses may be used to track the locations.
Storing the packet and processing it in parallel provides enhanced performance. Performing storage and processing in parallel can, however, lead to problems. For example, problems may occur if processing finishes before the entire packet is stored. If storing the packet takes longer than the processing, the system may attempt to read the packet out of the memory subsystem before the packet is completely is stored. Attempting to read out the packet before it is finished being written will result in reading out incorrect data, data that is not part of the packet. It is also possible that even though the packet is stored prior to the packet processing being finished, the packet data was corrupted in some way during writing, storage, or reading.
Therefore, there exists a need for systems and methods that ensure that stored information can be verified upon read out.